echo '挂载U盘中...'
umount /dev/sda2
mkdir -p /media/pi/
mount /dev/sda2 /media/pi/
cd /media/pi/

echo '复制程序中...'
cp -r /media/pi/work /home/pi/
chmod 777 /home/pi/work -R

echo '复制依赖中...'
cp /media/pi/bin/flutter-pi /usr/local/bin/flutter-pi
chmod 777 /usr/local/bin/flutter-pi

cp /media/pi/lib/icudtl.dat /usr/lib/
cp /media/pi/lib/libflutter_engine.so* /usr/lib/
chmod 777 /usr/lib/libflutter_engine.so*
chmod 777 /usr/lib/icudtl.dat

mkdir -p /data/db/
dpkg -i /media/pi/debs/* 1>/dev/null

cp /media/pi/etc/rc.local /etc/rc.local
chmod 777 /etc/rc.local

rm /etc/systemd/system/default.target
ln -s /lib/systemd/system/multi-user.target /etc/systemd/system/default.target

cp /media/pi/gnueabihf/libopencv* /usr/lib/arm-linux-gnueabihf/
chmod 777 /usr/lib/arm-linux-gnueabihf/libopencv*

sleep 3s

reboot